package com.rimi.controller;




import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

@Controller
public class ImageController {

    @RequestMapping(params="method=upImage")
    public String ImageController(HttpServletResponse response, HttpServletRequest request) throws IOException, UnsupportedEncodingException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");


        String path = request.getSession().getServletContext().getRealPath("/BackstageShoppingWebsite/images/addCircleimage");//保存的服务器地址


//        Map<String, String> map = UploadServiceImpl.upload(request, 1024 * 1024 * 10, path);


//        String file= map.get("file"); // 名称
//        String image = map.get("type"); // 图像
//        String newFile = map.get("newFile");// 地址

        return "/WEB-INF/upImage.jsp";
    }



    }

